import 'core-js/fn/object/assign';
import React from 'react';
import ReactDOM from 'react-dom';
import App from './components/Main';
import { Router, Route, hashHistory, IndexRedirect } from 'react-router';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import lightBaseTheme from 'material-ui/styles/baseThemes/lightBaseTheme';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

import Home from './components/Home/Home';
import Orders from './components/Orders/Orders';
import Partners from './components/Partners/Partners';
import PushSecret from './components/Secret/PushSecret';
import BuySecret from './components/Secret/BuySecret';

// Render the main component into the dom
//ReactDOM.render(<App />, document.getElementById('app'));

var theme = getMuiTheme(lightBaseTheme);
theme.bottomNavigation.unselectedColor = '#949494';
theme.bottomNavigation.selectedColor = '#3bc0e3';
theme.bottomNavigation.unselectedFontSize = '10px';

const Application = () => (
    <Router history={hashHistory} >
        <Route path="/" component={App}>
            <IndexRedirect to="/home"/>
            <Route path="/home" component={Home}/>
            <Route path="/orders" component={Orders}/>
            <Route path="/partners" component={Partners}/>
            <Route path="/pushSecret" component={PushSecret}/>
            <Route path="/buySecret" component={BuySecret}/>
        </Route>
    </Router>
);

ReactDOM.render((
    <MuiThemeProvider muiTheme={theme}>
        <Application />
    </MuiThemeProvider>
),document.getElementById('app'));
